// TOWN DIALOGUE SCRIPT
//    Town 0: Poulan

// This is the dialogue for this town.
// You can use states numbered from 1 to 99.

begintalkscript;
variables;

//**Mike**

begintalknode 1;
	state = -1;
	nextstate = 1;
	personality = 1;
	question = "Mike";
	text1 = "You meet a beanpole of a man, standing well over six feet tall. He glances up from some silk that he's examining and smiles at you.";
	text2 = "_Oh, hi. The name's Mike. Anything I can help you with?_";
	action = INTRO;
	text5 = "Mike stares at you and waits.";
	text6 = "_Anything else?_";

begintalknode 2;
	state = 1;
	nextstate = 2;
	question = "What brings you to Poulan?";
	text1 = "_I'm a traveling merchant. Although, I kind of like it here. Except for the dragon. If they find a way to get rid of the problem, I might just stick around._";
	text2 = "_Oh, speaking of which, I could sell you some stuff, or perhaps buy any excess items you have. I can also identify things for 5 coins apiece._";

begintalknode 3;
	state = 2;
	question = "I need some things identified.";
	text1 = "_Okay, sure._ He begins looking over your items.";
	action = ID 5;

begintalknode 4;
	state = 2;
	question = "Let's trade.";
	text1 = "You finish trading.";
	code = 
		begin_shop_mode("Trading with Mike","Mike has a lot of generic stuff, but he also has silk: a very rare material, even on the surface.",2,2,2);
		break;

//**Kev**

begintalknode 5;
	state = -1;
	nextstate = 3;
	question = "Kev";
	text1 = "You recognize the bartender as the man who treated you to food and lodging. He is a tall, skinny, friendly looking man with reddish hair. His skin is so pale that if you didn't know better, you'd think he was from Avernum.";
	text2 = "_Hey there! I hope you slept well. Anything I can get for you?_";
	action = INTRO;
	text5 = "Kev stands there, grinning at you. It's a little unnerving, but he's very friendly.";
	text6 = "_Welcome back to the Inn of Bones. Need anything?_";

begintalknode 6;
	state = 3;
	condition = get_flag(100,0) == 0;
	question = "Can you tell me where I can find the mayor?";
	text1 = "_Oh, yeah. Mayor Key's in the building right next door. To the east._";
	text2 = "He pauses. _But since you're here about the dragon problem, I'd suggest you see the town council. See, we run things a little differently around here. Mayor Key appointed three council members to deal with most things._";
	text3 = "_Mayor Key's the ultimate authority, but the council members deal with most of the issues. They consult him about most of them, but they are the ones to see._";
	action = SET_SDF 100 0 1;

begintalknode 7;
	state = 3;
	nextstate = 4;
	question = "What services do you offer?";
	text1 = "_Well, our rooms are pretty full right now, but I've made sure that the nicest one stays open for you. Only 20 coins._";
	text2 = "_Besides that, there's food and drink. We don't sell alcohol, because most of us prefer ice cold milk. It's what makes bones strong._ He flashes a quick smile. _Ten coins a jug._";

begintalknode 8;
	state = 4;
	question = "I'd like that room, please.";
	text1 = "_Alright. Hey Navigator!_ The boy sweeping floors and wiping tables looks up from his chores and rolls his eyes. _Take these folks to their room._";
	text2 = "The boy grumbles something about his _stupid nickname_ as he escorts you back to your room.";
	action = INN 20 18 9;
	code = 
		play_sound(20);
		break;

begintalknode 9;
	state = 4;
	question = "I need some food.";
	text1 = "You finish shopping.";
	code = 
		begin_shop_mode("Bones Food","The Inn of Bones has very high quality food. Kev says that the sweetie pie is better than a good goosing. You aren't sure what he means.",5,2,-1);
		break;

begintalknode 10;
	state = 4;
	question = "I think I want to try that milk.";
	text1 = "_Sure thing, caballero. Freshly milked from our own Baby._";
	code = 
		change_coins(-10);
		reward_give(449);
	break;

begintalknode 11;
	state = 3;
	question = "Tell me about the Inn of Bones.";
	text1 = "_Ah, you must have noticed that it's not like most inns. Well see, that's because it's more than just an inn. This is the place to be during the peace. We have big parties here all the time. Everyone in town is invited, and so are any guests._";
	text2 = "_Three of us are usually here. As you can see, I'm the bartender and owner here. Then there's Erin. We call her Chunks. She does the cooking. The one wandering around over there is Navigator. He cleans and waits the tables._";
	text3 = "_We're a pretty tightly knit community. I've taken to giving nicknames to the people I see often. Right, Rambo?_ A man at the far table looks up from his chess game and gives a thumbs up.";
	text4 = "Kev looks back to you. _That's about it. Anyway, I hope you like it here._";
	code = 
		if (get_flag(101,0) == 0)
			set_flag(101,0,1);
		break;

//**Ramiro**

begintalknode 12;
	state = -1;
	nextstate = 5;
	personality = 3;
	question = "Ramiro";
	text1 = "A big man sits in the chair here, smiling confidently at the game of chess that he's obviously winning.";
	text2 = "_Hey. I'm Ramiro. But people here call me Rambo._";
	action = INTRO;
	text5 = "Rambo is still sitting here, waiting patiently for his turn.";

begintalknode 13;
	state = 5;
	question = "What are you doing?";
	text1 = "_Well at the moment I'm waiting for Winton here to make his move. But I'm on my break. When I go back to work, I'll be fixing damage done in the valley. There's been a lot of that, thanks to the dragon._";
	text2 = "He looks back at the board, still unchanged. _Don't strain yourself, Winton._ The other man grunts in disapproval.";

//**Brendan**

begintalknode 14;
	state = -1;
	question = "Brendan";
	text1 = "This man is staring down at the chess game. He's losing. Badly.";
	text2 = "_Go away,_ he grunts. You oblige.";
	action = END_TALK;

//**Ryan**

begintalknode 15;
	state = -1;
	nextstate = 6;
	question = "Ryan";
	text1 = "This teenager is wandering around the room, sweeping the floor. Sometimes he picks up a cloth and wipes down some tables. He frequently shoots dirty looks at the bartender, who simply smiles back at him.";
	text2 = "When he notices you, he stops. _Oh, geez. What do you want?_";

begintalknode 16;
	state = 6;
	condition = get_flag(101,0) == 1;
	question = "Hello, Navigator.";
	text1 = "He hits you with the pole of his broom. _Don't call me that!_";
	text2 = "He glares at you for a moment before continuing his work.";
	code =
		damage_char(0,5,4);
	break;

begintalknode 17;
	state = 6;
	question = "What do you do?";
	text1 = "He looks down at the broom that he's been using and then looks back to you incredulously. _Are you stupid?_";
	text2 = "He shakes his head and continues sweeping, ignoring you.";

//**Erin**

begintalknode 18;
	state = -1;
	nextstate = 7;
	personality = 4;
	question = "Erin";
	text1 = "A slender woman stands by the counter, cooking food.";
	text2 = "_Hi there,_ she says, not looking up.";
	action = INTRO;
	text5 = "Erin is still standing here, cooking.";

begintalknode 19;
	state = 7;
	condition = get_flag(101,0) == 1;
	nextstate = 8;
	question = "Hi, Chunks.";
	text1 = "She looks up from her work and smiles at you. _Been talking to Kev, I see._";

begintalknode 20;
	state = 8;
	question = "Just curious, why are you called 'Chunks'?";
	text1 = "She chuckles. _It's a long story. Best we don't go in to it._";

begintalknode 21;
	state = 7;
	question = "Is that your cow outside?";
	text1 = "_Yep, that's my Baby. She's the one who supplies us with all of our milk. She's very special._";

begintalknode 22;
	state = 7;
	question = "Can I get some food?";
	text1 = "_Ask Kev about that. I just do the cooking._";

//**Mayor Key**

begintalknode 23;
	state = -1;
	nextstate = 9;
	personality = 5;
	question = "Mayor Key";
	text1 = "Here sits a man dressed in nice, yet casual clothing. He's balding and he has a mustache. He is currently hunched over a desk, writing something.";
	text2 = "He looks up when you approach, then rises. _Ah, hello. I'd heard that you had come. I'm Mayor Key. What can I do for you?_";
	action = INTRO;
	text5 = "Mayor Key watches you, glad to have your company.";

begintalknode 24;
	state = 9;
	nextstate = 10;
	question = "What is it you do here?";
	text1 = "He looks like he's about to answer, then he pauses, as if not quite sure what to say.";
	text2 = "_You know, I'm really not sure anymore. I am the mayor of Poulan, but that means little, I'm afraid._";
	text3 = "_You see, several years ago it was suggested to me that I form a council to make my job easier. They would represent the people to me, and we would discuss the issues as a group._";
	text4 = "_It did make my job easier, but most of the issues are so insignificant, it made my job nearly nonexistant. I thought for sure that this dragon business would bring my job back in to necessity, but it hasn't so far. I've become more of a figurehead._";
	text5 = "He sighs. _I don't even have paperwork to do, because I have Holmes to do it for me._";

begintalknode 25;
	state = 10;
	nextstate = 11;
	question = "So what do you do now?";
	text1 = "_Now?_ He waves his hand at the stack of papers on his desk. _Now I write music. It's been a passion for me all my life. Since I'm not really needed as mayor, now I have time to do this._";

begintalknode 26;
	state = 11;
	question = "What's that you're working on now?";
	text1 = "_The one I'm working on is about what's happening right now, with the dragon. It's going to be called 'In the Shadow of Dragons'._";

begintalknode 27;
	state = 11;
	question = "What have you written?";
	text1 = "_Oh, nothing you've heard of, I'm sure. If you want to, you can feel free to poke through those bookshelves. It's all unorganized, but you might find some of my works there._";

begintalknode 28;
	state = 9;
	question = "Tell us about our mission.";
	text1 = "_Ah, yes. Your mission._ He glances around, then looks at you apologetically. _Well, I'm afraid I don't know exact details, but it should be fairly self explanatory._";
	text2 = "_You see, there's this dragon, and it's been burning crops and buildings. What this town needs is for you to solve the problem somehow._";
	text3 = "_You should probably ask the town council about that, though. They're in the building to the south of this one._";

//**Holmes**

begintalknode 29;
	state = -1;
	nextstate = 12;
	question = "Holmes";
	text1 = "This uptight looking man is busy writing something. It looks like he's trying to dig a hole into the desk. He looks up at you when you approach. _What is it?_";

begintalknode 30;
	state = 12;
	question = "Is Mayor Key here?";
	text1 = "_Yes, yes._ He motions you toward the door to the northeast. _Mayor Key will see you._ He then returns to his work.";

//**Anna**

begintalknode 31;
	state = -1;
	nextstate = 13;
	personality = 6;
	question = "Anna";
	text1 = "A young woman is arranging some orange roses in a vase. She smiles at you when you come in, but she seems slightly melancholy.";
	text2 = "_Hi. I'm Anna. Can I help you?_";
	action = INTRO;
	text5 = "Anna is still arranging flowers.";

begintalknode 32;
	state = 13;
	question = "Is something wrong?";
	text1 = "She sighs. _Oh, it's nothing. I'm just worried about the dragon, that's all. I have friends that are off fighting it. I worry about them._";

begintalknode 33;
	state = 13;
	question = "Can I buy some flowers?";
	text1 = "She perks up a bit when you buy flowers. _I hope you like them._";
	code = 
		begin_shop_mode("Anna's Flowers","Anna doesn't have much of a selection, but the roses themselves are pretty.",6,2,-1);
	break;

//**Brian**

begintalknode 34;
	state = -1;
	personality = 12;
	question = "Brian";
	text1 = "This man is busily gathering traveling equipment. It would seem that he's one of the ones that's going out to help with the dragon problem.";
	text2 = "Noticing you doesn't slow him down at all, though he smiles cordially. _Listen, I'd love to talk, but I have to leave soon. They might need me out there._";
	text3 = "You decide to stay out of his way.";
	action = INTRO;
	text5 = "Brian is still busy. You leave him alone.";
	code = 
		if (get_flag(105,0) == 0)
			set_flag(105,0,1);
		break;

//**Jennifer 1**

begintalknode 35;
	state = -1;
	nextstate = 15;
	personality = 19;
	question = "Jennifer";
	text1 = "This woman is sitting at the table, watching the soldier here gather equipment with a worried expression on her face. Her expression doesn't change when she turns her attention toward you.";
	text2 = "_Hello. I'm Jennifer. Do you need something?_";
	action = INTRO;
	text5 = "Jennifer is still sitting here, stewing.";

begintalknode 36;
	state = 15;
	question = "What's wrong?";
	text1 = "She looks up cautiously at the soldier. _My husband, Brian, is going off to help the militia fight the dragon and its horde. It's an honorable cause, but I'm still worried about it._";
	text2 = "_Brian says that everything will be fine and tells me not to worry, but I can't help it._";
	text3 = "She peers up at him again, and he smiles at her reassuringly.";

//**Jennifer 2**

begintalknode 37;
	state = -1;
	nextstate = 16;
	personality = 19;
	question = "Jennifer";
	text1 = "This woman is sitting here, staring off into space. You clear your throat and she turns her attention toward you.";
	text2 = "_Hello. I'm Jennifer. What do you need?_";
	action = INTRO;
	text5 = "Jennifer is still sitting here. She seems to be lost in thought.";

begintalknode 38;
	state = 16;
	question = "What's the matter?";
	text1 = "She sighs. _My husband has gone off to defend the town from the dragon. He told me not to worry, but I do anyway._";
	text2 = "_Please, I need to be alone right now._";
	action = END_TALK;

//**Commander Scott**

begintalknode 39;
	state = -1;
	question = "Commander Scott";
	text1 = "Commander Scott is a haughty looking man with an impressive girth. He is currently reclining in his office. When you walk in, he glares at you.";
	text2 = "_Go away. I have no use for adventurers._";
	text3 = "Hmph. What an unpleasant person. You leave him to his arrogance.";
	action = END_TALK;

//**Milhous**

begintalknode 40;
	state = -1;
	question = "Milhous";
	text1 = "This soldier looks like a very calm, kind, and peaceful man. However, you won't know, as he is fast asleep and you don't have the heart to wake him.";

//**Harry**

begintalknode 41;
	state = -1;
	nextstate = 17;
	personality = 7;
	question = "Harry";
	text1 = "This soldier is staring off into the distance, whistling to pass the time. He doesn't seem to notice you.";
	action = INTRO;
	text5 = "Harry's still on watch.";

begintalknode 42;
	state = 17;
	nextstate = 18;
	question = "Ahem...";
	text1 = "He jumps when he hears you.";
	text2 = "_Oh! Hello. Don't scare me like that! I could have fallen!_ He gives a cautious glance at the distant ground. _That would have hurt a lot._";
	text3 = "_Anyway, I'm Harry. What can I do for you?_";

begintalknode 43;
	state = 18;
	question = "See anything?";
	text1 = "_Nope, nothing unusual. The dragon hasn't come out this far yet. Good thing, too. I'd probably be the first to go._ He chuckles ironically.";

begintalknode 44;
	state = 18;
	nextstate = 19;
	question = "Who's the guy in the chair?";
	text1 = "He smiles. _That's Milhous. Great guy, when he's awake._";

begintalknode 45;
	state = 19;
	question = "He sleeps a lot, then?";
	text1 = "Harry laughs. _That man could sleep through a bomb explosion. If we did get attacked by the dragon, he'd be the only one sleeping when it happened._";
	text2 = "He becomes serious when he stops to think about what this might mean.";

//**Chris**

begintalknode 46;
	state = -1;
	nextstate = 20;
	personality = 8;
	question = "Chris";
	text1 = "This young teenager is walking leisurely through the park, looking up at the statue in the fountain frequently. He grants you a little attention when you approach him.";
	text2 = "_Hey. I'm Chris._ He glances at your weapons casually.";
	action = INTRO;
	code = 
		if (get_flag(102,0) == 0)
			set_flag(102,0,1);
		break;
	text5 = "Chris is still here. He seems relaxed.";

begintalknode 47;
	state = 20;
	nextstate = 21;
	question = "What are you doing?";
	text1 = "_Oh, nothing._";

begintalknode 48;
	state = 21;
	question = "Nice statue, huh?";
	text1 = "He looks up at the statue again. _Yep._";

begintalknode 49;
	state = 20;
	condition = get_flag(200,1) == 0 && get_flag(103,0) == 0;//if dragon is alive
	question = "Shouldn't you be inside? It's dangerous out here with the dragon around.";
	text1 = "He looks you in the eye for what must be the first time. He looks like he's almost about to crack a smile.";
	text2 = "_Do you really think that being inside would make any difference?_";
	text3 = "He has a point.";
	action = SET_SDF 103 0 1;

//**Bianca**

begintalknode 50;
	state = -1;
	nextstate = 22;
	question = "Bianca";
	text1 = "This young woman looks exhausted. Nevertheless, she maintains a cheery disposition. She busies herself in the kitchen, cooking a pot of soup.";
	text2 = "_I'm Bianca. Need something?_";

 begintalknode 51;
	state = 22;
	nextstate = 23;
	question = "What do you do here?";
	text1 = "_I run the orphanage. The children have suffered a lot from the raids by the dragon and its hordes. Especially from the farms. I provide them with a place to stay._";
	text2 = "_Actually, it's not as bad as it could be. Most of the farmers escaped, then left the valley before the attacks hit their farms. There were just some unlucky ones._ She pauses as she stirs the soup.";
	text3 = "_Anyway, I keep a few of them here for a while, until they can find somewhere else to go._";

begintalknode 52;
	state = 23;
	nextstate = 24;
	question = "Where are all the children?";
	text1 = "_Oh, I only have three right now. The rest have found other people to live with. Relatives, mostly._";
	text2 = "_The ones that are still here are Becky, Colleen, and Chris. Becky and Colleen are in their room._ She motions toward the westernmost room. _I don't know where Chris is. He's always wandering off somewhere when I'm not looking._";

begintalknode 53;
	state = 24;
	condition = get_flag(102,0) == 1 && get_flag(104,0) == 0;
	question = "Chris is in the park.";
	text1 = "_Okay, thank you. I appreciate it. He's probably looking at that statue again._ She cuts some vegetables and tosses them in the pot.";
	action = SET_SDF 104 0 1;

begintalknode 54;
	state = 23;
	question = "What did you do before the attacks started?";
	text1 = "_I worked in a tavern near a farm. Things were good there, but then there was new management, and everything went downhill. I left when I decided I didn't want to deal with it anymore._";
	text2 = "_It's a good thing I got out when I did, too. The dragon appeared not long after I left. It was the first farm to get destroyed. Most who didn't get out before were killed._ She stops to think about it and wipes a tear from her eye.";

//**Becky**

begintalknode 55;
	state = -1;
	nextstate = 25;
	question = "Becky";
	text1 = "This teenage girl is drawing to pass the time. The picture she's drawing is of a fairy. It's very well done, and she's putting a lot of effort into drawing it.";
	text2 = "You watch her for a moment, before she finally sets down her pen and looks up at you. _Hi, I'm Becky._";

begintalknode 56;
	state = 25;
	question = "That's a very good drawing.";
	text1 = "She glances down at it when you mention it. _Thanks. It's not great, but I guess it's alright._ She notices something about it she doesn't like, then makes an adjustment. She seems anxious to get back to work.";

//**Colleen**

begintalknode 57;
	state = -1;
	nextstate = 26;
	question = "Colleen";
	text1 = "An attractive teenage girl is walking around the room aimlessly. She looks slightly amused by your desire to talk to her.";
	text2 = "_I'm Colleen. Are you taking time out of your busy life to talk to me?_";

begintalknode 58;
	state = 26;
	nextstate = 27;
	question = "What are you doing?";
	text1 = "_Well, up 'til now I was wandering around my room, being bored while Becky complains about not being able to draw very well._";
	text2 = "_Right now, I'm wondering what help or advice you are looking for, that would merit talking to a kid like me. Seems you have more important things to be doing right now, don't you?_ She smiles.";

begintalknode 59;
	state = 27;
	question = "Well, I guess...";
	text1 = "She smiles at you, clearly quite entertained. You seem to have made her day more interesting, if nothing else.";
	action = END_TALK;

//**Town Council**

begintalknode 60;
	state = -1;
	nextstate = 28;
	personality = 20;
	question = "Town Council";
	text1 = "The man in the center of the podium before you speaks immediately. _Hello. I'm Councilman Jensen. This is Councilman Kumagai, and Councilwoman Luczo._ He motions to the man at his left and the woman at his right as he says this.";
	text2 = "_We're glad you've come. I trust you've heard everything already, but I will reiterate, just to clarify._";
	text3 = "_Recently, there have been attacks by a dragon and its army of lizards. The attacks were unprovoked, and completely unexpected._";
	action = INTRO;
	text5 = "The council is sitting here, staring at you.";
	text6 = "Councilman Jensen speaks up. _Is there something else we can help you with? There is much that needs our attention._";

begintalknode 61;
	state = 28;
	question = "I thought dragons were extinct. Isn't that what the Empire told us all?";
	text1 = "Councilwoman Luczo speaks now. _That's what everyone thought. It turns out the Empire thought they knew a lot of things they didn't actually know._";

begintalknode 62;
	state = 28;
	nextstate = 29;
	condition = get_flag(106,0) == 0;
	question = "What exactly do you need?";
	text1 = "Councilman Kumagai replies to you now. _It's simple. We want you to make the attacks stop. In little time, the lizards have decimated entire farmlands. But we've seen increases in their numbers._";
	text2 = "_None have reached Poulan yet, but they will before long._";
	text3 = "Councilman Jensen speaks again. _If you want, find out why the dragon has been attacking, but the reason isn't what's important. What matters is that it's happening, and it needs to stop. So will you help?_";

begintalknode 63;
	state = 29;
	question = "No, I don't think so.";
	text1 = "Councilwoman Luczo frowns. _Then why are you here? If you've not come to help us, then you should probably return to where you came from._";
	action = END_TALK;

begintalknode 64;
	state = 29;
	question = "Okay, we'll see what we can do.";
	text1 = "Councilman Jensen smiles. _Good. Then here's what you should do. Seek out Captain Terronez. He is the officer in charge of the war camp. If anyone can give you information to help you, it will be him._";
	text2 = "He continues, _The war camp is up north, just on the other side of the bridge. You'll have to look carefully, because it'll be hard to find._";
	text3 = "Jensen looks at his colleagues, then back at you. _Thank you. We wish you good luck on your quest. Report back to us when you've completed it._";
	action = END_TALK;
	code =
		set_flag(106,0,1);
		toggle_quest(0,1);
		toggle_quest(1,1);
	break;

begintalknode 65;
	state = 28;
	condition = get_flag(200,5) == 1;
	question = "It's done! The dragon Gavin is dead!";
	text1 = "You explain to the council everything that happened since you last saw them. They listen intently, until you finish.";
	text2 = "Then they sit there and contemplate everything you've told them. Finally, Councilman Jensen speaks up. _So... they aren't all gone, after all. This is fascinating and frightening news. Do you realize what this could mean for this world?_";
	text3 = "He shakes his head. _Well, no matter. You've done as we requested, and you deserve a reward for that._ He pulls out a bag of coins and hands it to you. _This isn't much, but it's all we can give you, in light of the damage done to this valley._";
	text4 = "Your quest is at an end. When you're ready, leave Poulan through the south exit.";
	code =
		set_flag(200,5,2);
		change_coins(500);
		award_party_xp(500,1);
		toggle_quest(0,0);
	break;

begintalknode 66;
	state = 28;
	condition = get_flag(200,5) == 2);
	question = "So what's going to happen now?";
	text1 = "Kumagai speaks this time. _Well, reparations have to be made to the valley. Now that the dragon is gone, we can begin._";
	text2 = "_Plus, there's a merchant in town that might be able to help us get back on our feet with trade. He sells rare silk!_";
	text3 = "_Anyway, not to worry. Poulan valley will prosper again, if not for a long time. You have helped us a lot. Thank you._";